package com.local.controller.index;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import com.local.model.WorkTransition;
import com.local.page.LocalWorkTransPage;
import com.local.service.face.LocalWorkTransService;
import com.qianhai.common.constants.CommonContans;
import com.qianhai.common.controller.BaseController;

/**
 * 
 * 类描述： 工作交接
 * 
 * @ClassName: LocalIndexWorkTransController
 * @author Administrator
 * @date 2015年10月3日 下午1:06:02
 */
@RestController
@RequestMapping(value = "/index/workTrans", method = RequestMethod.POST)
public class LocalIndexWorkTransController extends BaseController
{
	@Autowired
	private LocalWorkTransService localWorkTransService;
	
	@RequestMapping(value = "/queryWorkTransByPage.action", consumes = "application/json", produces = "application/json")
	@ResponseBody
	public ModelMap queryWorkTransByPage(
			@RequestBody LocalWorkTransPage<WorkTransition> page)
	{
		ModelMap resultMap = new ModelMap();
		
		try
		{
			localWorkTransService.queryByPage(page);
			resultMap.put(CommonContans.STRUTS_DATA, page);
			resultMap.put(CommonContans.STRUTS_RESULT,
					CommonContans.STRUTS_SUCCESS);
			
		} catch (Throwable e)
		{
			// 请保持所有代码一直性，没有特殊处理请使用该代码.
			this.printExction(resultMap, e);
		}
		return resultMap;
	}
	
	
}
